<!DOCTYPE html>
<html>
<head>
	<title>Bus/总线/发布订阅/观察者模式</title>
	<meta charset="utf-8">
	<script type="text/javascript" src="./js/vue.js"></script>
	<style type="text/css">
		
		
	</style>
</head>
<body>
	<div id="app">
		<child >
			<template scope="props">
				<!-- scope的作用是接收来自组件绑定的属性值 -->

				<li>{{props.item}}</li>
				
			</template>



		<!-- 	<template scope="props">

				<li>{{props.index}}</li>
				
			</template> -->



			
		</child>  
		
		
	</div>
</body>
<script type="text/javascript">

	Vue.component("child",{
		data: function() {
			return {
				list:["feixia", "jianfneg", "love", "together"]
			}
		},

		template:'<div><ul><slot v-for="item of list" :item = item></slot></ul></div>'
		
		
	})
	

	var vm = new Vue({
		el:"#app",
		data:{
	
		},

	})



		
</script>
</html>